package com.hyou.starter.autoconfigure.sc.endpoints.shutdown;

import org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnEnabledEndpoint;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.netflix.discovery.DiscoveryClient;

@Configuration
@ConditionalOnClass(DiscoveryClient.class)
@ConditionalOnProperty(prefix = "management", name = "endpoint", matchIfMissing = true)
public class ShutdownEndpointAutoConfiguration {
    
    @Bean
    @ConditionalOnMissingBean
    @ConditionalOnEnabledEndpoint
    public ShutdownEndpoint shutdownEndpoint() {
        return new ShutdownEndpoint();
    }
    
}
